<%@page import="java.util.Map"%>
<%@page import="org.jasig.cas.client.authentication.AttributePrincipal"%>
<%@page import="com.AppUtils"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%  
session.invalidate();  
String url = AppUtils.config.get("casServerLogoutUrl")+"?service="+AppUtils.config.get("serverName");  
%>  
 hello cas-client2<br/>
 <%
AttributePrincipal principal = (AttributePrincipal) request.getUserPrincipal();
if (principal != null) {
        Map<String, Object> attributes = principal.getAttributes();
        if (attributes.size() > 0) {
            String id = attributes.get("id").toString();
            String name = attributes.get("name").toString();
            String email = attributes.get("email").toString();
            System.err.println("id="+id+"  name="+name+" email="+email);
            %>
            用户信息:id:<%=id %> name:<%=name %> email:<%=email %>
            <%
        }
}
%>
 <br/>
<a href="<%=AppUtils.config.get("casPortalUrl")%>">门户(cas-portal)</a> 
<a href="<%=url%>">退出</a>
</body>
</html>